package org.example.school.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 点对点消息/聊天记录表
 * </p>
 *
 * @author author
 * @since 2025-09-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("messages")
public class Messages implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 发送方用户ID
     */
    private Long senderId;

    /**
     * 接收方用户ID
     */
    private Long recipientId;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 是否已读 (1:已读, 0:未读)
     */
    private Boolean isRead;

    /**
     * 发送时间
     */
    private LocalDateTime sentAt;
    
    /**
     * 消息类型 (text:文本, image:图片, file:文件)
     */
    private String messageType;
    
    /**
     * 消息状态 (sent:已发送, delivered:已送达, read:已读)
     */
    private String status;
    
    /**
     * 更新时间
     */
    private LocalDateTime updatedAt;


}